package Month07.day25;

import java.util.Collection;
import java.util.Iterator;
import java.util.TreeSet;

public class DemoSet {
    public static void main(String[] args) {
        Collection<String> collection = new TreeSet<>();
        collection.add("ccc");
        collection.add("aaa");
        collection.add("aaa");
        collection.add("bbb");
        Iterator<String> iterator = collection.iterator();
        while (iterator.hasNext()){
            String s=iterator.next();
            System.out.println(s);
        }
    }
}
